//
//  SQLHelper.h
//  LearningFMDB
//
//  Created by dihuijun on 17/9/12.
//  Copyright © 2017年 Cycle. All rights reserved.
//

#import <Foundation/Foundation.h>
@class Person,Car;
@interface SQLHelper : NSObject

/** 初始化 */
+ (instancetype)sharedSQLHelper;



#pragma mark ---- Person类
/**
 *  添加person
 */
- (void)addPerson:(Person *)person;
/**
 *  删除person
 */
- (void)deletePerson:(Person *)person;
/**
 *  更新person
 */
- (void)updatePerson:(Person *)person;
/**
 * 获取所有数据
 */
- (NSMutableArray<Person *> *)getAllPerson;
/**
 * 为person修改头像
 */
- (void)updatePersonHeadImage:(Person *)p;

#pragma mark --- Car
/**
 *  给Person 添加车辆
 */
- (void)addCar:(Car *)car toPerson:(Person *)person;
/**
 * 给Person 删除车辆
 */
- (void)deleteCar:(Car *)car fromPerson:(Person *)person;
/**
 *  获取person的所有车辆
 */
- (NSMutableArray<Car *>*)getAllCarsFromPerson:(Person *)person;
/**
 *  删除person的所有车辆
 */
- (void)deleteAllCarsFromPerson:(Person *)person;






@end
